<?php 
require_once("../include/conn.php");
require_once("../include/page.php");
$table=$tb_dz;
$id=0;
$lanmu=$title=$nname=$basesql='';
if (isset($_GET['name'])) {
	$nname=$_REQUEST['name'];
}
if (isset($_GET['id'])) {
	$id=$_REQUEST['id'];
}
if ($nname=='1') {//
	$title='生产日况管理';
	$table=$tb_rk;
}elseif ($nname=='3'){//
	$title='任务图表管理';
	$basesql=' and  buid<8 ';
}elseif ($nname=='4'){//
	$title='学习天地管理';
	$basesql='  and buid >9 and buid<19 ';
}elseif ($nname=='9'){//
	$title='任务图表管理';
	$basesql='  and buid in(23,24) ';
}else {//
	self("参数不全!","admin_index.php");
}

$page=$_GET['page'];
$perpage=20;
$sql_all="select count(*) from   $table  where `isdel`='1'   $basesql ";
$con   =   mysql_db_query($db_name,$sql_all);   
$num   =   mysql_result($con,0);   //   统计当前总的记录数   
$list=new page($num,$page,$perpage);  
$strartrow=$list->getStartRow();
$sql   =   "select   *   from    $table  where `isdel`='1'   $basesql  order  by   id   DESC   limit $strartrow,$perpage";   //从上面的起点开始查询出20条数据   
$cn_ma   =   mysql_db_query($db_name,$sql); 
?>
<html>
<head>
<title><?php echo $title ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%"  border="0" cellpadding="0" cellspacing="2">
  <tr class="topbg">
    <th colspan="4"><?php echo $title ?></th>
  </tr>
  <tr>
    <td width="28%">&nbsp;</td>
    <td width="26%">&nbsp;</td>
    <td width="18%">&nbsp;</td>
    <td width="28%">&nbsp;</td>
  </tr>
  <tr class="tdbg">
    <td>标题</td>
    <td>原归属栏目</td>
    <td>日期</td>
    <td>操作</td>
  </tr>
  <?php
   while($row_ma = mysql_fetch_array($cn_ma)) {	   
   	$lmxx="select * from $tb_bm where id='".$row_ma[buid]."'";
	$lm_conn=mysql_query($lmxx);   
	if(strlen($row_ma[pic])>25) $msg="<font color=\"red\">[图片]</font>";
		else $msg="";
	?>
  <tr class="tdbg">
    <td><?php echo $msg ?><a href='../dtshow.php?id=<?php echo $row_ma[id] ?>&nname=<?php echo $row_ma[buid] ?>' target='_blank' ><?php echo substr_cut($row_ma[title],24); ?></a><?php if($row_ma[jian]==1){echo "<font color=red>&nbsp;&nbsp;&nbsp;通  知</font>"; }?></td>
    <td><?php  if($lm_row=mysql_fetch_row($lm_conn)){  echo $lm_row[1]; } ?></td>
    <td><?php
	 $row_ma[tdate]=substr(fendate($row_ma[tdate]),5);
		echo $row_ma[tdate];
?></td>
    <td>&nbsp;&nbsp;<a href="Admin_del.php?id=<?=$row_ma[id];?>&action=resume&name=<?php echo $nname ?>" title="将该文件从回收站中还原到原来栏目!">还原记录</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="Admin_del.php?id=<?=$row_ma[id];?>&action=pack&name=<?php echo $nname ?>" title="千万要注意哟,删除了就找不回来了!">永久删除</a></td>
  </tr>
    <?php }?>
  
  <tr  align="center">
    <td colspan="4" style="font-size:20px;"><?php echo $list->showPageList()?> </td>
  </tr>  
</table>
</body>
</html>